<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableCats extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cats', function (Blueprint $table) {
            $table->increments('cat_id')->comment('栏目主键id');
            $table->char('cat_name',10)->default('')->comment('栏目名称');
            $table->tinyInteger('parentid')->default(0)->comment('父栏目id');
            $table->integer('count')->default(0)->comment('栏目下文章总数');
            $table->tinyInteger('cat_status')->default(1)->comment('栏目状态,1为正常,0为删除');
          });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('cats');
    }
}
